home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / classes / requester.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-10-19  |  6.7 KB  |  191 lines

  1. #ifndef CLASSES_REQUESTER_H
  2. #define CLASSES_REQUESTER_H
  3. /*
  4. **    $VER: requester.h 44.1 (19.10.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    requester.class definitions
  8. **
  9. **    (C) Copyright 1987-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. /*****************************************************************************/
  14.  
  15. #ifndef REACTION_REACTION_H
  16. #include <reaction/reaction.h>
  17. #endif
  18.  
  19. /*****************************************************************************/
  20.  
  21. /* Attributes defined by the requester.gadget class
  22.  */
  23. #define REQ_Dummy                (REACTION_Dummy + 0x45000)
  24. #define REQS_Dummy                (REQ_Dummy + 0x100)
  25. #define REQI_Dummy                (REQ_Dummy + 0x200)
  26. #define REQP_Dummy                (REQ_Dummy + 0x300)
  27.  
  28. #define    REQ_Type                (REQ_Dummy+1)
  29.     /* (ULONG) Type of requester. See definitions below.
  30.             (default: REQTYPE_INFO) (OM_NEW, OM_SET, RM_OPENREQ) */
  31.  
  32. #define    REQ_TitleText            (REQ_Dummy+2)
  33.     /* (UBYTE *) Title text of the requester (default: None)
  34.                 (OM_NEW, OM_SET, RM_OPENREQ) */
  35.  
  36. #define    REQ_BodyText            (REQ_Dummy+3)
  37.     /* (UBYTE *) Body text of the requester (default: None)
  38.                 (OM_NEW, OM_SET, RM_OPENREQ) */
  39.  
  40. #define    REQ_GadgetText            (REQ_Dummy+4)
  41.     /* (UBYTE *) Gadget text(s) for the requester
  42.             (default: " _Ok | _Cancel ") (OM_NEW, OM_SET, RM_OPENREQ) */
  43.  
  44. #define    REQ_ReturnCode            (REQ_Dummy+5)
  45.     /* (ULONG) Last return code of the requester (default: 0)
  46.                 (OM_GET) */
  47.  
  48. #define    REQ_TabSize                (REQ_Dummy+6) /* NOT IMPLEMENTED YET */
  49.     /* (ULONG) Tab size to use when formatting the bodytext (default: 8)
  50.                 (OM_NEW, OM_SET, RM_OPENREQ) */
  51.  
  52. /**********************************
  53. * integer request type attributes *
  54. **********************************/
  55.  
  56. #define REQI_Minimum             (REQI_Dummy+1)
  57.     /* (LONG) Minimum allowed value (default: MININT) (OM_NEW, OM_SET, RM_OPENREQ) */
  58.  
  59. #define REQI_Maximum             (REQI_Dummy+2)
  60.     /* (LONG) Maximum allowed value (default: MAXINT) (OM_NEW, OM_SET, RM_OPENREQ) */
  61.  
  62. #define    REQI_Invisible            (REQI_Dummy+3) /* NOT IMPLEMENTED YET */
  63.     /* (BOOL) Integer input will be echoed with '.' and not what the user
  64.             actually types (default: FALSE) (OM_NEW, OM_SET, RM_OPENREQ) */
  65.  
  66. #define    REQI_Number                (REQI_Dummy+4)
  67.     /* (LONG) Number to show in gadget (default: 0)
  68.             (OM_NEW, OM_SET, OM_GET, RM_OPENREQ) */
  69.  
  70. #define    REQI_Arrows                (REQI_Dummy+5)
  71.     /* (BOOL) Show arrows to the right of the integer gadget (default: FALSE)
  72.             (OM_NEW, OM_SET, RM_OPENREQ) */
  73.  
  74. #define    REQI_MaxChars            (REQI_Dummy+6)
  75.     /* (UWORD) Maximum number of characters for the number (including negative
  76.             sign). (default: 10) (OM_NEW, OM_SET, RM_OPENREQ) */
  77.  
  78. /*********************************
  79. * string request type attributes *
  80. *********************************/
  81.  
  82. #define    REQS_AllowEmpty         (REQS_Dummy+1)
  83.     /* (BOOL) Allow empty string to be accepted. (default: FALSE)
  84.             (OM_NEW, OM_SET, RM_OPENREQ) */
  85.  
  86. #define    REQS_Invisible            (REQI_Invisible) /* NOT IMPLEMENTED YET */
  87.     /* (BOOL) String input will be echoed with '.' and not what the user
  88.             actually types (default: FALSE) (OM_NEW, OM_SET, RM_OPENREQ) */
  89.  
  90. #define    REQS_Buffer                (REQS_Dummy+2)
  91.     /* (UBYTE *) Buffer used in the string gadget. MUST be provided.
  92.             (OM_NEW, OM_SET, RM_OPENREQ) */
  93.  
  94. #define    REQS_ShowDefault        (REQS_Dummy+3)
  95.     /* (BOOL) Show content of REQS_Buffer in string gadget. (default: TRUE)
  96.             (OM_NEW, OM_SET, RM_OPENREQ) */
  97.  
  98. #define    REQS_MaxChars            (REQS_Dummy+4)
  99.     /* (ULONG) Maximum number of characters in string gadget. Must not be
  100.             larger than size of REQS_Buffer - 1. (default: 127)
  101.             (OM_NEW, OM_SET, RM_OPENREQ) */
  102.  
  103. #define    REQS_ChooserArray        (REQS_Dummy+5)
  104.     /* (UBYTE **) An array of strings that will be added to a chooser gadget
  105.             to the right of the string gadget.
  106.             (OM_NEW, OM_SET, RM_OPENREQ) */
  107.  
  108. #define    REQS_ChooserActive    (REQS_Dummy+6)
  109.     /* (ULONG) The current active entry among the strings passed in
  110.             using REQS_ChooserOptions.  (default: 0)
  111.             (OM_NEW, OM_SET, OM_GET, RM_OPENREQ) */
  112.  
  113. /**********************************
  114. * progress window type attributes *
  115. **********************************/
  116.  
  117. #define REQP_Total                (REQP_Dummy+1)
  118.     /* (ULONG) Total number of levels for the progressbar. (default: 100)
  119.             (OM_NEW, OM_SET, RM_OPENREQ) */
  120. #define REQP_Current            (REQP_Dummy+2)
  121.     /* (ULONG) The current level of the progressbar. (default: 0)
  122.             (OM_NEW, OM_SET, RM_OPENREQ) */
  123. #define REQP_AbortText            REQ_GadgetText
  124.     /* (UBYTE *) Text to be put into the gadget that will abort the progressbar.
  125.             If not present, no gadget will be created.
  126.             (OM_NEW, OM_SET, RM_OPENREQ) */
  127. #define REQP_ProgressText        REQ_BodyText
  128.     /* (UBYTE *) Text to be shown over the progressbar.
  129.             (OM_NEW, OM_SET, RM_OPENREQ) */
  130. #define REQP_OpenInactive        (REQP_Dummy+3)
  131.     /* (BOOL) Open window inactive if ta_Data is TRUE.
  132.             (OM_NEW, RM_OPENREQ) */
  133. #define REQP_NoText                (REQP_Dummy+4)
  134.     /* (BOOL)  No text-gadget in progressbar if ti_Data is TRUE
  135.             (OM_NEW, RM_OPENREQ) */
  136. #define REQP_Dynamic            (REQP_Dummy+5)
  137.     /* (BOOL)  TRUE if the pb should size automatically when
  138.         a too long progresstext is set. Default is TRUE.
  139.         (OM_NEW, OM_SET, RM_OPENREQ) */
  140. #define REQP_CenterWindow        (REQP_Dummy+6)
  141.     /* (struct Window *) The progressbar is centered over this window.
  142.         (OM_NEW, OM_SET, RM_OPENREQ) */
  143. #define REQP_LastPosition        (REQP_Dummy+7)
  144.     /* (BOOL) Open progressbar on the same place the last was. Default is TRUE.
  145.         (OM_NEW, OM_SET, RM_OPENREQ) */
  146. #define REQP_Percent            (REQP_Dummy+8)
  147.     /* (BOOL) Render numeric percentage display.
  148.         (OM_NEW, RM_OPENREQ) */
  149. #define REQP_Ticks                (REQP_Dummy+9)
  150.     /* (WORD) If present, how many tick marks
  151.         (OM_NEW, RM_OPENREQ) */
  152. #define REQP_ShortTicks            (REQP_Dummy+10)
  153.     /* (BOOL) Enable small intermediate tick marks.
  154.         (OM_NEW, RM_OPENREQ) */
  155.  
  156. /*****************************************************************************/
  157.  
  158. /*
  159.  * requester.class methods
  160.  */
  161. #define RM_OPENREQ        (0x650001L)
  162.  
  163. /* The RM_OPENREQ method should be called whenever you want to open
  164.  * a requester.
  165.  */
  166.  
  167. struct orRequest
  168. {
  169.     ULONG MethodID;                /* RM_OPENREQ */
  170.     struct TagItem *or_Attrs;    /* List of tag attributes */
  171.     struct Window *or_Window;    /* Reference window for requester. */
  172.     struct Screen *or_Screen;    /* Reference screen for requester. REQUIRED if or_Window is */
  173.                                 /* not supplied */
  174. };
  175.  
  176. /* The REQ_Type must be used to set what type of requester you
  177.  * want to use. Here are the definitions:
  178.  */
  179. #define REQTYPE_INFO        0        /* Normal information/query requester like EasyRequest() */
  180. #define REQTYPE_INTEGER        1        /* Get an integer from the user */
  181. #define REQTYPE_STRING        2        /* Get a string from the user */
  182. #define REQTYPE_PROGRESS    3        /* Progressbar window (NOT IMPLEMENTED YET) */
  183.  
  184. /* Useful macros */
  185. #ifndef RequesterObject
  186. #define OpenRequester(obj, win)    DoMethod(obj, RM_OPENREQ, NULL, win, NULL, TAG_DONE)
  187. #define RequesterObject            NewObject(REQUESTER_GetClass(), NULL
  188. #endif
  189.  
  190. #endif /* CLASSES_REQUESTER_H */
  191.